package com.ronglian.jmsSubscriber;

import java.io.IOException;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jms.listener.DefaultMessageListenerContainer;

/**
 * Hello world!
 *
 */
public class App 
{
	ApplicationContext ctx = null;  
	DefaultMessageListenerContainer javaConsumer;
	public void run() throws IOException {
		ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
		javaConsumer = ctx.getBean("javaConsumer",DefaultMessageListenerContainer.class);
		javaConsumer.start();
		while(true){
			System.in.read();
		}
	}
    public static void main( String[] args ) throws IOException
    {
        App app = new App() ;
        app.run();
    }
}
